from django.db import models

# Create your models here.
class Course(models.Model):
    course_id = models.CharField("课程号", max_length=20, primary_key=True)
    name = models.CharField("课程名", max_length=100)
    college = models.ForeignKey("classapp.College", on_delete=models.CASCADE)
    credit = models.IntegerField("学分")
    teacher = models.ForeignKey("teacherapp.Teacher", on_delete=models.CASCADE)
    textbook = models.ForeignKey("textbookapp.Textbook", on_delete=models.SET_NULL, null=True)